home *** CD-ROM | disk | FTP | other *** search
/ Explorer - Mosaic & Web / Explorer - Mosaic & Web.iso / urbstuff / unix / findfile < prev    next >
Encoding:
Text File  |  1995-01-15  |  1.2 KB  |  44 lines

  1.  # Script "findfile" used to send an email search request to an archie server #
  2.  # 
  3.  # The syntax is:
  4.  #              findfile string
  5.  # replace string with the file name (or substring) to find.
  6.  #
  7.  # Test to see if there is a passed parameter
  8.  #
  9. if test -z "$1"  
  10.   then # There is no passed parameter
  11.     echo
  12.     echo "The syntax for this script is:"
  13.     echo "     find <search-string>"
  14.     echo "replacing <search-string> (without the <>) with"
  15.     echo "a string, or substring, that is the name of the"
  16.     echo "file you are trying to locate"
  17.     echo
  18.   else  # There is a passed parameter
  19.     # Create a file archie.tmp and write the following five string 
  20.     echo "set search sub" > archie.tmp 
  21.     echo "set output_format terse" >> archie.tmp
  22.     echo "set sortby rfilename" >> archie.tmp
  23.     echo "set maxhits 200" >> archie.tmp
  24.     echo 'find' $1 >> archie.tmp       # Write string with passed parameter
  25.     echo "quit" >> archie.tmp         
  26.     # Mail file archie.tmp to archie server
  27.     # Substitute your favorite archie server below 
  28.     #
  29.     mail archie@archie.rutgers.edu < archie.tmp
  30.     rm archie.tmp  # Delete file archie.tmp
  31. fi # end if
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.